package com.sun.jvm;

public class StringTest {
    public static void main(String[] args) {
        // 示例1：基本行为
        String s1 = new String("abc");
        String s2 = s1.intern();
        System.out.println(s1 == s2);

        // 示例2：更复杂的场景
        String s3 = new StringBuilder().append("ja").append("va").toString();
        String s4 = s3.intern();
        System.out.println(s3 == s4);
    }
}
